package myJs.myPkg

import org.scalajs.dom
import org.scalajs.dom.Blob
import slinky.readwrite.ObjectOrWritten

import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport


case class WriteOptions(
    bookType: js.UndefOr[String] = js.undefined,
    bookSST: js.UndefOr[Boolean] = js.undefined,
    `type`: js.UndefOr[String] = js.undefined
)
@js.native
@JSImport("xlsx", JSImport.Default)
object Xlsx extends js.Object {
  def utils: UtilsT = js.native
  def write(workBook: WorkBook, options: ObjectOrWritten[WriteOptions]): Blob  = js.native
}
@js.native
trait WorkBook extends js.Object
@js.native
trait WorkSheet extends js.Object
@js.native
trait UtilsT extends js.Object {
  def json_to_sheet(str: js.Dynamic): WorkSheet = js.native
  def aoa_to_sheet(data: ObjectOrWritten[List[List[String]]]): WorkSheet = js.native
  def book_new(): WorkBook = js.native
  def book_append_sheet(workBook: WorkBook, workSheet: WorkSheet): Unit = js.native
}
